using System.Web.Mvc;

namespace FiltronASP.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            ///grupy stron
            context.MapRoute(
                    "PageGroupsList",
                    "Admin/PageGroups/List/{currentLanguageId}/{page}",
                    new { controller = "PageGroups", action = "Index" }
            );

            context.MapRoute(
                    "PageGroupsListNoLanguage",
                    "Admin/PageGroups/List/{page}",
                    new { controller = "PageGroups", action = "Index" }
            );

            ///wersje jezykowe
            context.MapRoute(
                    "LanguagesList",
                    "Admin/Languages/List/{currentLanguageId}/{page}",
                    new { controller = "Languages", action = "Index" }
            );

            context.MapRoute(
                    "LanguagesListNoLanguage",
                    "Admin/Languages/List/{page}",
                    new { controller = "Languages", action = "Index" }
            );

            ///uzytkownicy
            context.MapRoute(
                    "UsersList",
                    "Admin/Users/Page/{page}",
                    new { controller = "Users", action = "Index" }
            );

            ///menus
            context.MapRoute(
                    "MenusList",
                    "Admin/Menus/List/{currentLanguageId}/{menuItemId}/{menuId}/{page}",
                    new { controller = "Menus", action = "Index" }
            );

            ///menus
            context.MapRoute(
                    "MenusListNoMenuItem",
                    "Admin/Menus/List/{currentLanguageId}/{menuId}/{page}",
                    new { controller = "Menus", action = "Index" }
            );

            ///pages
            context.MapRoute(
                    "PagesList",
                    "Admin/Pages/List/{currentLanguageId}/{pageTypeId}/{page}",
                    new { controller = "Pages", action = "Index" }
            );

            ///pages (bez pagetypu)
            context.MapRoute(
                    "PagesListNoPageType",
                    "Admin/Pages/List/{currentLanguageId}/{page}",
                    new { controller = "Pages", action = "Index" }
            );

            ///pages (bez pagetypu i jezyka)
            context.MapRoute(
                    "PagesListNoPageTypeNorLanguage",
                    "Admin/Pages/List/{page}",
                    new { controller = "Pages", action = "Index" }
            );

            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", controller = "Account", id = UrlParameter.Optional }
            );

        }
    }
}
